﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.T.BasicData.ErrorCode
{
    public class ApiResult
    {
        public ApiREunm code {  get; set; }= ApiREunm.Fail;

        public string msg { get; set; } = "操作失败";

        public object data {  get; set; }

        public void success(string msg = "操作成功")
        {
            this.msg = msg;
            this.code= ApiREunm.Ok;
        }
    }
    public class ApiResult<T>
    {
        public ApiREunm code { get; set; } = ApiREunm.Fail;

        public string msg { get; set; } = "操作失败";

        public T data { get; set; }

        public void success(T data,string msg = "操作成功")
        {
            this.msg = msg;
            this.code = ApiREunm.Ok;
            this.data = data;
        }
    }
}
